<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="cn.edu.ecut.se2024.controller.SupplierMgmtController" %>

<style type="text/css">
	.button {
		border: none;
		border-radius: 5px;  /* 按钮圆角 */
		transition-duration: 0.3s;  /* 过渡效果持续时间 */
		font-size: 16px;
		color: #FFFFFF;
		background-color: #4B9E5F;
		width: 50px;
		height: 40px;
	}
	.button:hover {
		background-color: #4682B4;
	}
	.button-table {
		border-collapse: collapse;
		border-spacing: 5px;
	}
	.button-table td {
		text-align: center;
		vertical-align: center;
		padding: 5px;
	}
</style>

<script>
	// 发起返回请求
	function back() {
		document.getElementById("backSupplierForm").submit();
	}
</script>

<%	// 获取用户权力
	String user_power = (String)request.getSession().getAttribute(SupplierMgmtController.SUPPLIER_MGMT_POWER);
	// 判断用户是否有管理权力
	boolean have_mgmt_power = false;
	if (user_power != null && user_power.equals(SupplierMgmtController.SUPPLIER_MGMT_POWER_MGMT)) {
		have_mgmt_power = true;
	}	
	// 获取提示信息
	String tip = (String)request.getAttribute(SupplierMgmtController.SUPPLIER_MGMT_TIP);
%>

<!-- 隐藏的“返回”提交表单 -->
<form id="backSupplierForm" action=<%=have_mgmt_power ? "suppliermgmt.mgmt" : "suppliermgmt.see" %> method="post" style="display: none;"></form>

<table class="button-table">
	<tr><td><h3><%=tip %></h3></td></tr>
	<tr><td><input type="button" class="button" name="goback" value="确定" onclick="back()"></td></tr>
</table>
